﻿@model IEnumerable<HRWEB.ResearchIdentification>
@using HRWEB.HtmlHelpers
@{
    ViewBag.Title = "修改课题鉴定";
}

<script type="text/javascript">
    $(document).ready(function () { $("[name='upfile']").fileupload({ dataType: 'jason' }); });
</script>
<div align="center" style="padding-top:30px">
@Html.ActionLink("返回", "Back")
<div style="font-weight:bold;" class="jp-detail-head">课题鉴定</div>
<table class="detail-table-edit">
<thead>
    <tr>@Html.GetTableHeadRowTD(new string[] { "时间","题目","位次","鉴定单位","鉴定水平","得分","下载", "上传", "删除", "选择" })
    @if (User.IsInRole("EduMaster"))
    { <th>确认</th>}</tr>
</thead>
<tbody>
@if (!Model.Any())
{
    <tr align="left"><td colspan="2">没有数据可以显示</td></tr>
}
@foreach (var it in Model)
{
    <tr class="@if (it.Selected) { <text>jp-table-row-selected</text> }"><td>@it.Date.ToString("yyyy")</td><td>@it.Name</td><td>@it.Ordinal</td><td>@it.Department</td><td>@Html.FormatTDict(it.DictResearchIdentificationGrade)</td><td>&nbsp;</td><td>@if (it.Filename != null)
                                                                                                                                                                                                                                                                     {<a href="@Url.Content("~/CertFiles/ResearchIdentification/"+@it.Filename)">下载</a>}
                                                                                                                                                                                                                                                                     else {<font>无</font>}</td>
 <td>@if (!it.Confirmed)
     {<input type="file" name="upfile" id="file @it.SerialNO" style="width:70px" data-url="@Url.Action("UploadCertFile", new { serial = @it.SerialNO })" /> }</td>
    <td>@if (!it.Confirmed)
        {
            if (User.IsInRole("EduMaster"))
            {
                @Html.ActionLink("删除", "AdminDelete", new { serial = it.SerialNO });
            }
            else
            {
                @Html.ActionLink("删除", "Delete", new { serial = it.SerialNO });
            }
        }</td>
<td>@if (it.Confirmed)
    {
        if (!it.Selected)
        { @Html.ActionLink("选择", "Select", new { serial = it.SerialNO, isMaster = User.IsInRole("EduMaster") });
        }
        else
        { @Html.ActionLink("不选", "Select", new { serial = it.SerialNO, isMaster = User.IsInRole("EduMaster") });
        }
    }
</td>@if (User.IsInRole("EduMaster"))
     {<td>@if (it.Confirmed) { @Html.ActionLink("取消", "Confirm", new { serial = it.SerialNO }); }
         else { @Html.ActionLink("确认", "Confirm", new { serial = it.SerialNO }); }</td>}</tr>    
}
</tbody>
</table>
</div>